package Queue;

import java.util.Arrays;


public class QueueTest {
    public static void main(String[] args) {
        int[] arr={3,5,2,1,7,6,9,8};
        Queue queue=new PriorityQueue();
//        PriorityQueue<Integer> queue=new PriorityQueue<>();
        for (int i :arr) {
            queue.offer(i);
        }
        for (int i = 0; i < arr.length; i++) {
            arr[i]=queue.poll();
        }
        System.out.println(Arrays.toString(arr));
    }
}
